package com.jr.service.impl;

import com.jr.entry.User;
import com.jr.mapper.UserMapper;
import com.jr.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    public UserMapper userMapper;


    @Override
    public boolean loginUser(User user) {
        return userMapper.insertUser(user)>0?true:false;
    }

    @Override
    public boolean loginByPhoneAndPassword(User user) {
        User user1 = userMapper.selectByPhoneAndPassword(user).get(0);
        boolean b = user1 == null ? false : true;
        return b;
    }
}
